﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ERTesting.Model.Config;

namespace ERTesting.Dao
{
    public interface ITestConfigService
    {
        /// <summary>
        /// Gets all the test groups.
        /// </summary>
        /// <param name="callback"></param>
        void GetTestGroups(Action<IEnumerable<TestGroup>, Exception> callback);


        void GetSheetsForGroup(TestGroup groupViewModel, Action<IEnumerable<SheetConfig>, Exception> callback);

        /// <summary>
        /// Gets the scenarios for a particular sheet. The method does not return anything, but returns the results via a callback.
        /// </summary>
        /// <param name="sheetConfig">The sheet to get the scenarios for.</param>
        /// <param name="callback">The callback action to pass the results to.</param>
        void GetScenariosForSheet(SheetConfig sheetConfig, Action<IEnumerable<Scenario>, Exception> callback);

        /// <summary>
        /// Gets all the input parameters for a scenario.
        /// </summary>
        /// <param name="scenario">The scenario to get the parameters for.</param>
        /// <param name="callback">The callback action to pass the results to.</param>
        /// <param name="includeBaseScenarios">If true the input parameters for the base scenarios are returned in the set.</param>
        void GetInputParametersForScenario(Scenario scenario, Action<IEnumerable<TestParameter>, Exception> callback,  bool includeBaseScenarios = true);

        /// <summary>
        /// Gets all the output parameters for a scenario.
        /// </summary>
        /// <param name="scenario">The scenario to get the parameters for.</param>
        /// <param name="callback">The callback action to pass the results to.</param>
        /// <param name="includeBaseScenarios">If true the output parameters for the base scenarios are returned in the set.</param>
        void GetOutputParametersForScenario(Scenario scenario, Action<IEnumerable<TestOutputParameter>, Exception> callback, bool includeBaseScenarios = true);

        /// <summary>
        /// Saves a test group to store.
        /// </summary>
        /// <param name="testGroup"></param>
        void SaveTestGroup(TestGroup testGroup);

        /// <summary>
        /// Removes the sheet config and all scenarios from the config store.
        /// </summary>
        /// <param name="sheetConfig"></param>
        void RemoveSheetConfig(SheetConfig sheetConfig);
    }
}
